//2009/08/21 12:33:06
#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <queue>
#include <sstream>
#include <algorithm>

using namespace std;

class SantaGifts
{
public:
    vector <string> distribute(vector <string> gifts, int N)
    {
        vector<string> v(N,"");
        for (int i=0; i<gifts.size()&&i<4*N; i++)
        {
            if (v[i%N].size() == 0)
                v[i%N] += gifts[i];
            else
                v[i%N] += " " + gifts[i];
        }
        return v;
    }
};
